<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>父子组件传值</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=0">
    <script src="../react/react.development.js"></script>
    <script src="../react/react-dom.development.js"></script>
    <script src="../react/babel.min.js"></script>
    <script src="../react/prop-types.js"></script>
</head>
<body>
<div id="root">

</div>
<script type="text/babel">
    class Comp extends React.Component {
        // static defaultProps = {
        //     name: 'cqg'
        // }
        //
        // static propTypes = {
        //     name: PropTypes.string
        // }
        render () {
            console.log(this.props)
            return <h1>{this.props.name}</h1>
        }
    }

    // Comp.propTypes = {
    //     name: PropTypes.string
    // }
    let s1 = {
        a: 1,
        b: 2
    }
    let s2 = {
        c: 3,
        d: 4
    }
    ReactDOM.render(<Comp name="程麒阁" {...s2}/>, document.getElementById('root'))
</script>
</body>
</html>
